<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:app="http://java.sun.com/jsf/composite/app"
              xmlns:ds="http://deltaset.org/deltaset-faces"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:c="http://java.sun.com/jsp/jstl/core">


    <ds:titlebar title="#{offerRideMsg['view.title']}"/>


    <ds:fieldset rendered="#{not empty offerRideModel.id}">


        <ds:outputText label="#{offerRideMsg['description']}" value="#{offerRideModel.description}"/>
        <ds:outputDate label="#{offerRideMsg['startTime']}" value="#{offerRideModel.startTime}"/>
        <ds:outputText label="#{offerRideMsg['repeatType']}" value="#{offerRideModel.repeatType}"/>
        <ds:outputText label="#{offerRideMsg['rideState']}" value="#{offerRideModel.rideState}"/> 

    </ds:fieldset>

    <ds:fieldset rendered="#{empty offerRideModel.id}">

        Please select OfferRide <br/>

    </ds:fieldset>


    <c:set target="#{viewScope}" property="offerRidePageHelperMTO" value="#{offerRideBean.all(param.page)}"/>
    <ds:pagedDataTable rendered="#{not empty offerRideTarget}"
                       title="All OfferRides"
                       pageHelper="#{viewScope.offerRidePageHelperMTO}"
                       pageParamName="page">
                       
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{offerRideMsg['description']}"/>
                </f:facet>
                <h:outputText value="#{item.description}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{offerRideMsg['startTime']}"/>
                </f:facet>
                <ds:outputDate value="#{item.startTime}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{offerRideMsg['repeatType']}"/>
                </f:facet>
                <h:outputText value="#{item.repeatType}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{offerRideMsg['rideState']}"/>
                </f:facet>
                <h:outputText value="#{item.rideState}"/>
            </h:column>
 

        <h:column>
            <h:commandButton styleClass="ds-button"
                             onmouseup="this.blur()"
                             immediate="true"
                             action="#{offerRideBean.setModelTo(item,offerRideTarget)}"
                             value="Select">
                <f:ajax execute="@form" render="@form"/>
            </h:commandButton>
        </h:column>
    </ds:pagedDataTable>

</ui:component>